<?php

namespace App\Providers;

use EasyWeChat\Factory;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{

    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        Schema::defaultStringLength(191);
        $this->app->configure('filesystems');

        $this->app->singleton('wechat', function () {
            $config = config('wechat');
            $wechat = Factory::miniProgram($config);
            return $wechat;
        });

        $this->app->singleton('wechatPayment', function () {
            $payment = config('payment');
            $wechatPayment = Factory::payment($payment);
            return $wechatPayment;
        });
    }

    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
//        Schema::defaultStringLength(191);
    }
}
